package com.ktwlsoft.archivemanage.domain.business.repositoryService;

import java.util.List;

import com.ktwlsoft.archivemanage.domain.dao.entity.BusinessDic;
import com.ktwlsoft.archivemanage.domain.dao.repository.IBusinessDicMapper;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

/**
 * business_dic--业务字段业务层接口实现类
 *
 * @author zhuhe on 2019-10-24 14:19:39
 * @version 1.0
 */
@Service
public class BusinessDicRepositoryService {
	
	private final IBusinessDicMapper businessDicMapper;

	public BusinessDicRepositoryService(IBusinessDicMapper businessDicMapper) {
		this.businessDicMapper = businessDicMapper;
	}

	/**
 	 * 查询分页 on 2019-10-24 14:19:39
 	 * @param pn 第几页
     * @param pageSize 每页多少条
 	 * @param businessDic businessDic
 	 * @return PageInfo<BusinessDic>
 	 */
	public PageInfo<BusinessDic> findPage(int pn, int pageSize, BusinessDic businessDic) {
		PageHelper.startPage(pn,pageSize);
		PageInfo<BusinessDic> pageInfo = new PageInfo<BusinessDic>(businessDicMapper.findList(businessDic));
		return pageInfo;
	}

    /**
	 * 查询集合 on 2019-10-24 14:19:39
	 * @param businessDic businessDic
	 * @return List<BusinessDic>
	 */
	public List<BusinessDic> findList(BusinessDic businessDic) {
		return businessDicMapper.findList(businessDic);
	}

	/**
	 * 根据id查询信息 on 2019-10-24 14:19:39
	 * @param id id
	 * @return BusinessDic
	 */
	public BusinessDic getById(Long id){
		return businessDicMapper.getById(id);
	}

    /**
	 * 根据值查询信息 on 2019-10-24 14:19:39
	 * @param businessDic	businessDic
	 * @return BusinessDic
	 */
	public List<BusinessDic> getByDicValue(BusinessDic businessDic){
		return businessDicMapper.getByDicValue(businessDic);
	}

   /**
	 * 新增 on 2019-10-24 14:19:39
	 * @param businessDic businessDic
	 * @return int
	 */
	public int insert(BusinessDic businessDic){
		return businessDicMapper.insert(businessDic);
	}

   /**
	 * 修改 on 2019-10-24 14:19:39
	 * @param businessDic businessDic
	 * @return int
	 */
	public int update(BusinessDic businessDic){
		return businessDicMapper.update(businessDic);
	}

   /**
	 * 根据id集合批量删除信息 on 2019-10-24 14:19:39
	 * @param businessDicArr	主键编号集合
	 * @return int
	 */
	public int deleteByIds(List<Long> businessDicArr){
		return businessDicMapper.deleteByIds(businessDicArr);
	}

   /**
	 * 根据id删除信息 on 2019-10-24 14:19:39
	 * @param id id
	 * @return int
	 */
	public int deleteById(Long id){
		return businessDicMapper.deleteById(id);
	}
}
